﻿using System;
using System.Text;
using System.IO;
using System.Xml;


namespace RtaInfoCMD
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            if (args == null || args.Length < 1)
                ShowHelp();
            else
            {
                var data = new MatrixInterface();
                string outPut;

                switch (args[1].ToUpper())
                {
                    case "DESC":
                        outPut = MatrixInterface.GetDescription(args[0]);
                        break;

                    case "ID":
                        outPut = MatrixInterface.GetId(args[0]);
                        break;

                    case "COM":
                        outPut = MatrixInterface.GetComments(args[0]);
                        break;

                    case "CUST":
                        outPut = MatrixInterface.GetCustomer(args[0]);
                        break;

                    case "ATTR":
                        if (args[2] == null || args[2] == "")
                            outPut = "INVALID ARGS";
                        else
                            outPut = MatrixInterface.GetAttribute(args[0], args[2]);
                        break;

                    default:
                        outPut = "INVALID ARGS";
                        break;
                }

                // Output Result
                Console.WriteLine(outPut);

				#if DEBUG
					Console.WriteLine("Press any key to continue...");
					Console.ReadKey(true);
				#endif
            }
        }



		/// <summary>Shows the help.</summary>
        private static void ShowHelp()
        {
            string hTxt;
            using (var sr = new StreamReader(AppDomain.CurrentDomain.BaseDirectory + "Help.txt"))
            {
                hTxt = sr.ReadToEnd();
            }
            Console.WriteLine(hTxt);
        }
    }
}